let { ordersModel } = require('../dao/models/ordersModel');
//页面渲染
module.exports.getsOrders = async () => {
    return await ordersModel.find()
        .populate('insuresId')
        .populate('usersId');
};

//修改订单
module.exports.confirmAlterOrders = async ({ _id, time, state, insuresId, usersId }) => {
    let data = await ordersModel.updateOne({ _id }, { time, state, insuresId, usersId });
    return data;
}

//根据ID删除订单
module.exports.deleteOrders = async function (_id) {
    return await ordersModel.deleteOne(_id)
}